package cn.iocoder.yudao.module.handguard.dal.mysql.userbasetable13;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable13.UserBaseTable13DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.app.userbasetable13.vo.*;

/**
 * 企业发票贷 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserBaseTable13Mapper extends BaseMapperX<UserBaseTable13DO> {

    default PageResult<UserBaseTable13DO> selectPage(UserBaseTable13PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserBaseTable13DO>()
                .eqIfPresent(UserBaseTable13DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable13DO::getYearAmount, reqVO.getYearAmount())
                .eqIfPresent(UserBaseTable13DO::getLiabilities, reqVO.getLiabilities())
                .betweenIfPresent(UserBaseTable13DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable13DO::getId));
    }

    default List<UserBaseTable13DO> selectList(UserBaseTable13ExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserBaseTable13DO>()
                .eqIfPresent(UserBaseTable13DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable13DO::getYearAmount, reqVO.getYearAmount())
                .eqIfPresent(UserBaseTable13DO::getLiabilities, reqVO.getLiabilities())
                .betweenIfPresent(UserBaseTable13DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable13DO::getId));
    }

}
